import request from '@/utils/request'

/**
 * 获取文章列表信息
 * @param {*}} id
 * @param {*} timestamp
 * @returns
 */
export const getArticleList = (id, timestamp) => {
  return request({
    method: 'get',
    url: '/v1_1/articles',
    // url: '/v1_0/articles',
    params: {
      channel_id: id,
      timestamp,
      with_top: 1
    }
  })
}

/**
 * 对文章不感兴趣
 * @param {*} id
 * @returns
 */
export function dislikeArticle (id) {
  return request({
    method: 'POST',
    url: '/v1_0/article/dislikes',
    // post请求接收数据是data
    data: {
      target: id
    }
  })
}

export function reportArticle (id, type) {
  return request({
    method: 'POST',
    url: '/v1_0/article/reports',
    data: {
      target: id,
      type
    }
  })
}
